package com.yuchen.advsdk.model;

import org.litepal.crud.LitePalSupport;

public class DbVideoFile extends LitePalSupport {
    private String url;
    private String path;
    private long downloadTime;
    private long lastPlayTime;
    private int status;
    private String md5;
    private int retryCount;

    public DbVideoFile() {
    }

    public DbVideoFile(String url, String md5, long downloadTime) {
        this.url = url;
        this.downloadTime = downloadTime;
        this.lastPlayTime = downloadTime;
        this.md5 = md5;
        this.status = Status.STATUS_WAITING;
        this.retryCount = 0;
    }

    public int getRetryCount() {
        return retryCount;
    }

    public void setRetryCount(int retryCount) {
        this.retryCount = retryCount;
    }

    public String getMd5() {
        return md5;
    }

    public void setMd5(String md5) {
        this.md5 = md5;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public long getDownloadTime() {
        return downloadTime;
    }

    public void setDownloadTime(long downloadTime) {
        this.downloadTime = downloadTime;
    }

    public long getLastPlayTime() {
        return lastPlayTime;
    }

    public void setLastPlayTime(long lastPlayTime) {
        this.lastPlayTime = lastPlayTime;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public interface Status{
        int STATUS_WAITING = 0;
        int STATUS_DOWNLOADING = 1;
        int STATUS_PAUSE = 2;
        int STATUS_SUCCESS = 3;
        int STATUS_ERROR = 4;
        int STATUS_DISCARD = 5;
    }

    @Override
    public String toString() {
        return "DbVideoFile{" +
                "url='" + url + '\'' +
                ", path='" + path + '\'' +
                ", downloadTime=" + downloadTime +
                ", lastPlayTime=" + lastPlayTime +
                ", status=" + status +
                ", md5='" + md5 + '\'' +
                '}';
    }
}
